Skip to content

swift: better support#5452

Merged
mawww merged 4 commits intomawww:masterfrom
paaloeye:feat/better-swift-support
Mar 6, 2026
Merged

swift: better support#5452
mawww merged 4 commits intomawww:masterfrom
paaloeye:feat/better-swift-support

Conversation

@paaloeye
Copy link
Contributor

@paaloeye paaloeye commented Mar 2, 2026

List of improvements

  • added InsertChar hooks for newline and closing brace
  • added comment continuation for // and /// comments
  • added automatic indentation after opening braces
  • added automatic de-indentation for closing braces
  • added automatic de-indentation for closures
  • added basic tests
  • implementation based on zig.kak patterns
  • added support for \() interpolation syntax in Swift strings
  • added support for both regular strings and multiline strings
  • added better numeric literal support (hex, binary, octal, floats with underscores)
  • expanded keyword list with async/await, actor, protocol, and other modern Swift keywords
  • expanded type list including standard library types and SIMD types
  • added compilation directive support (#if, #available, etc.)
  • added discard literal _ highlighting
  • updated attributes list with modern Swift modifiers
  • added support for escaped identifiers using backticks

@paaloeye paaloeye force-pushed the feat/better-swift-support branch from 1800c15 to a02c099 Compare March 2, 2026 05:38
@paaloeye
Copy link
Contributor Author

paaloeye commented Mar 2, 2026

While it's still a WIP, I'd love to get some feedback. Thank you!

@mawww
Copy link
Owner

mawww commented Mar 2, 2026

At first glance that looks pretty good, kudos for adding tests

@paaloeye paaloeye force-pushed the feat/better-swift-support branch from 952d087 to 13777a5 Compare March 4, 2026 03:14
@paaloeye
Copy link
Contributor Author

paaloeye commented Mar 4, 2026

@mawww I'm quite happy with Swift support now :)

Never mind the regression, #5453 should address it.

I'd like your opinion on:

  • using comment for _ literal
  • pretty advance regex for numerals

Other than that, it's ready to merge (I think). Cheers!

Paal Øye-Strømme and others added 3 commits March 5, 2026 15:29
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
- added InsertChar hooks for newline and closing brace
- added comment continuation for // and /// comments
- added automatic indentation after opening braces
- added automatic de-indentation for closing braces
- added automatic de-indentation for closures
- added basic tests
- implementation based on zig.kak patterns

Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
- added support for \() interpolation syntax in Swift strings
- added support for both regular strings and multiline strings

Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
@paaloeye paaloeye force-pushed the feat/better-swift-support branch 2 times, most recently from 13777a5 to da005d6 Compare March 5, 2026 14:29
- added better numeric literal support (hex, binary, octal, floats with underscores)
- expanded keyword list with async/await, actor, protocol, and other modern Swift keywords
- expanded type list including standard library types and SIMD types
- added compilation directive support (#if, #available, etc.)
- added discard literal (_) highlighting
- updated attributes list with modern Swift modifiers
- added support for escaped identifiers using backticks

Signed-Off-By: Paal Øye-Strømme <paal.o.eye@gmail.com>
@paaloeye paaloeye force-pushed the feat/better-swift-support branch from da005d6 to 4c579de Compare March 5, 2026 14:36
@mawww mawww merged commit 4c579de into mawww:master Mar 6, 2026
2 of 6 checks passed
@paaloeye paaloeye deleted the feat/better-swift-support branch March 7, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants